package fun.werfamily.wf.user.core.domain.service;
import com.baomidou.mybatisplus.extension.service.IService;
import fun.werfamily.wf.user.core.domain.dto.resp.UserAddressDTO;
import fun.werfamily.wf.user.core.domain.dto.resp.UserAddressIdDTO;
import fun.werfamily.wf.user.core.infrastructure.dataobject.UserAddressDO;

import java.util.List;

public interface IUserAddressService extends IService<UserAddressDO> {

    /**
     * 用户收货地址列表
     *
     * @param userCode
     * @return
     */
    List<UserAddressDTO> listByUserId(String userCode);

    /**
     * 收货地址详情
     *
     * @param userAddressIdDTO
     * @return
     */
    UserAddressDTO getDetailById(UserAddressIdDTO userAddressIdDTO);

    /**
     * 保存收货地址
     *
     * @param userAddressDTO
     * @return
     */
    Boolean saveAddress(UserAddressDTO userAddressDTO);

    /**
     * 更新收货地址
     *
     * @param userAddressDTO
     * @return
     */
    Boolean updateAddress(UserAddressDTO userAddressDTO);

    /**
     * 删除收货地址
     *
     * @param userAddressIdDTO
     * @return
     */
    Boolean deleteAddress(UserAddressIdDTO userAddressIdDTO);

    /**
     * 设置默认收货地址
     *
     * @param userAddressIdDTO
     * @return
     */
    Boolean setDefault(UserAddressIdDTO userAddressIdDTO);

    /**
     * 获取默认收货地址
     *
     * @param userCode
     * @return
     */
    UserAddressDTO getDefault(String userCode);
}
